Skip to content

Conversation

@hgraca
Copy link
Contributor

@hgraca hgraca commented Sep 18, 2023

By allowing createFileParser to be called with null we need less code everywhere else to create a default file parser.

By allowing createFileParser to be called with null
we need less code everywhere else to create a default file parser.
public static function createFileParser(TargetPhpVersion $targetPhpVersion, bool $parseCustomAnnotations = true): FileParser
{
public static function createFileParser(
TargetPhpVersion $targetPhpVersion = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TargetPhpVersion $targetPhpVersion = null,
?TargetPhpVersion $targetPhpVersion = null,

I assume this should be explicitly marked as a nullable type instead of depending on implicit PHP behaviour.

}

public static function create(?string $version): self
public static function create(string $version = null): self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static function create(string $version = null): self
public static function create(?string $version = null): self

as above

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants